import request from "../request"

// 查询课程列表
export function QueryCoursePage(data) {
  return request({
    url: "/course/admin/course/page",
    method: "post",
    isHide: true,
    data,
  })
}

// 查询课程详情
export function CourseDetail(id) {
  return request({
    url: `/course/admin/course/view?id=${id}`,
    method: "get",
  })
}

// 获取课程下章节列表
export function QueryChapterByCourse(data) {
  return request({
    url: "/course/auth/course/view",
    method: "post",
    data,
  })
}

// 收藏课程
export function CollectCourse(data) {
  return request({
    url: "/course/auth/user/course/collect/add",
    method: "post",
    data,
  })
}

// 查询收藏课程列表
export function CollectList(data) {
  return request({
    url: "/course/auth/user/course/collect/page",
    method: "post",
    data,
  })
}

// 课程评论列表查询
export function CommentList(data) {
  return request({
    url: "/course/api/course/comment",
    method: "post",
    data,
  })
}

// 课程评论列表查询
export function AddComment(data) {
  return request({
    url: "/course/auth/user/course/comment/add",
    method: "post",
    data,
  })
}

// 获取章节素材列表
export function QueryChapterMaterialByCourseId(data) {
  return request({
    url: "/course/admin/course/chapter/period/list",
    method: "post",
    data,
  })
}

// 获取studyId
export function GetStudyId(data) {
  return request({
    url: "/course/auth/course/sign",
    method: "post",
    data,
  })
}

// 记录学习进度
export function RecordStudyProgress(data) {
  return request({
    url: "/course/api/user/study/progress",
    method: "post",
    data,
    isHide: true,
  })
}
